package thread;

public class SharedVariable {
    public static void main(String[] args) {
        Worker worker = new Worker();
        for (int i = 0; i < 3; i++) {
            Thread t = new Thread(worker);
            t.start();
        }
    }
}

class Worker implements Runnable {
    private Integer v = 0;

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            v++;
            System.out.println(v);
        }
    }
}
